variable=$(cat /home/pi/count)
#echo $variable
b=6
DATE=$(date)

#new=$(($variable + 1)) 
#echo $new > /home/pi/count

if [ "$variable" -gt "$b" ]; then
    echo  "greater then"
    echo 0 >  /home/pi/count
    echo  "time to reboot"
    echo 1 > /home/pi/reboot_flag
    echo reboot due to count $DATE  >> /home/pi/lastReboot   
    sudo reboot
fi
